package com.vma.jifu.orderList.service;

import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import com.vma.jifu.bizModel.model.OrderList;

import java.util.Map;

/**
 * Created by chenzui on 2017/6/16.
 */
public interface OrderService {
    /**
     * 生成订单
     * @param addressId
     * @param offerId
     * @param offer_num
     * @param remark
     * @param offerPrice
     * @return
     */
    public Map commit(Integer userId,Integer addressId,Integer offerId,Integer offer_num,String remark,Integer offerPrice);

    /**
     * 查询用户的订单列表，带分页
     * @param userId
     * @param cPage
     * @param pSize
     * @param status
     * @return
     */
    public Page<OrderList> qryOrderListByPage(Integer userId,Integer cPage,Integer pSize,Integer status);

    /**
     * 查询一级下级订单
     * @param userId
     * @param cPage
     * @param pSize
     * @param status
     * @return
     */
    public Page<OrderList> qryFistOrderListByPage(Integer userId,Integer cPage,Integer pSize,Integer status);

    public Page<OrderList> qrySecondOrderListByPage(Integer userId,Integer cPage,Integer pSize,Integer status);

    public Page<OrderList> qryThirdOrderListByPage(Integer userId,Integer cPage,Integer pSize,Integer status);

    /**
     * 查询津贴订单
     * @param userId
     * @param cPage
     * @param pSize
     * @param status
     * @return
     */
    public Page<OrderList> qryJTOrderListByPage(Integer userId,Integer cPage,Integer pSize,Integer status);


    /**
     * 后台查询用户的订单列表，带分页
     *
     * @param cPage
     * @param pSize
     * @param status
     * @return
     */
    public Page<Record> qryOrderList(Integer cPage, Integer pSize, String status, String ordernbr, String province, String city, String area, String start, String end,String offerName);

    /**
     * 更新订单状态
     * @param userId
     * @param orderId
     * @param status
     */
    public void updateOrder(Integer userId,Integer orderId,Integer status);

    /**
     * 查询订单详情
     * @param userId
     * @param orderId
     * @return
     */
    public OrderList getOrderDetail(Integer userId,Integer orderId);

    /**
     * 支付回调
     * @param orderNbr
     * @param fee
     * @return
     */
    public boolean callBackForOrder(String orderNbr,Integer payType);

    /**
     * 查询我的下级某个时间段内的订单
     * @param userId
     * @param cPage
     * @param pSize
     * @param start
     * @param end
     * @return
     */
    public Page<OrderList> qryMyAgentOrders(Integer userId,Integer agentId,Integer cPage,Integer pSize,String start,String end);

    /**
     * 查询各类订单状态
     * @param userId
     * @return
     */
    public Map qryOrderCnt(Integer userId);


    public Page<OrderList> qryAreaOrder(Integer areaId,Integer type,Integer cPage,Integer pSize);
}
